<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>增加网页元素</title>
<link href="css/base.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/calendar/calendar.js"></script>
<script src="../include/js/jquery/jquery.js" language="javascript" type="text/javascript"></script>
<script lang='javascript' src='js/tb-box.js'></script>
<script language="javascript">
function checkSubmit()
{
	if(document.form1.title.value=="")
	{
		alert("标题不为能空！");
		document.form1.title.focus();
		return false;
	}
}
function postip($this){
	var text = $this.find('option:selected').attr('tabname');
	$('#postip').html(text);
}
$(function(){
	postip($('#position'));
});

function SelectTemplets(id)
{
   var posLeft = 400;
   var posTop = 200;
   var url = $("#"+id).val();
   if(!url){
   		alert('未上传图片！');
   }
   window.open("../admin_back/selectimg.php?url="+url, "poptempWin", "scrollbars=no,resizable=no,statebar=no,width=300,height=200,left="+posLeft+", top="+posTop);
}
  
</script>
<style type="text/css">
.typetab {
	text-align: left;
}
.typetab ul {
	list-style: none;
}
.typetab ul li {
	float: left;
	margin: 5px 5px 0px;
	height: 23px;
	width: 64px;
	background: url(images/adtype_link.gif) no-repeat scroll 0px 0px;
	line-height: 23px;
	text-align: center;
	cursor: pointer;
}
.typetab ul .act {
	background: url(images/adtype_act.gif) no-repeat scroll 0px 0px;
}
.i_table {
	border: 1px solid #CCC;
}
</style>
</head>
<body background="images/allbg.gif" leftmargin='8' topmargin='8'>
<form action="web_edit.php" method="post" name="form1" enctype="multipart/form-data" onSubmit="return checkSubmit()">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6">
  <tr>
    <td height="28" background="images/tbg.gif" style="padding-left:10px;"><b><a href="web_main.php"><u>网页元素管理</u></a></b> &gt;&gt; 增加网页元素 </td>
  </tr>
  <tr>
    <td height="200" bgcolor="#FFFFFF" valign="top"><table width="100%" border="0" cellspacing="4" cellpadding="4">
 
          <input type='hidden' name='dopost' value='editsave'>
           <tr>
            <td height="25" align="center">栏目：</td>
            <td colspan="2">
              <?php
              $typeOptions = GetOptionList($row['arctype_id'],$cuserLogin->getUserChannel(),$channelid);
              echo "<select name='arctype_id' id='arctype_id' style='width:240px'>\r\n";
              echo "<option value='0'>请选择栏目...</option>\r\n";
              echo $typeOptions;
              echo "</select>";
         ?></td>
          </tr>
          <tr>
            <td height="25" align="center">位置：</td>
            <td colspan="2"><select name='position' style='width:200px;' id="position" onchange="postip($(this))">
                <option value='0'>请选择...</option>
                <?php echo inc_web::select_position_option($row['position']);?>
              </select>
              <br />
              <div style="color:#333333; line-height:25px; color:#FF0000;" id="postip"></div>
              </td>
          </tr>
          <tr>
            <td height="25" align="center">标题：</td>
            <td colspan="2"><input name="title" type="text" id="tagname" class='iptxt' value="<?php echo $row['title']?>" style="width:400px"/>
              </td>
          </tr>
          <tr>
            <td height="25" align="center">说明：</td>
            <td colspan="2"><textarea class="input" name="remark" id="remark" style="width:400px; height:100px;"><?php echo $row['remark']?></textarea></td>
          </tr>
            <tr>
            <td height="25" align="center">链接：</td>
            <td colspan="2"><input name="link" type="text" id="tagname" value="<?php echo $row['link']?>" class='iptxt' style='width:340px'/></td>
          </tr>
		  <tr>
          <td height="25" align="center">大图片：</td>
          <td colspan="2"><input name="big_img2" type="file" id="big_img2"  size="50" />
          <input name="big_img" type="hidden" id="big_img" style="width:240px" value="<?php echo $row['big_img']?>" />
          <?php if($row['big_img']): ?>&nbsp;&nbsp;&nbsp; <a href="<?php echo $row['big_img']?>" target="_blank"><strong>查看已有图片</strong></a>  <?php else:?>没有上传大图片<?php endif;?>        </td>
          </tr>
          <tr>
          <td height="25" align="center">小图片：</td>
          <td colspan="2"><input name="small_img2" type="file" id="small_img2"  size="50"/>
          <input name="small_img" type="hidden" id="small_img" style="width:240px" value="<?php echo $row['small_img']?>" /><?php if($row['small_img']): ?>&nbsp;&nbsp;&nbsp; <a href="<?php echo $row['small_img']?>" target="_blank"><strong>查看已有图片</strong></a><?php else:?> 没有上传小图片<?php endif;?>          </tr>
          <tr>
            <td height="25" align="center">序号：</td>
            <td colspan="2"><input name="sort" type="text" id="sort" size="10" class='iptxt' value="<?php echo $row['sort']?>"/></td>
          </tr>
          <tr>
            <td height="53" align="center"><input name="web_id" type="hidden" id="web_id" size="10" class='iptxt' value="<?php echo $row['web_id']?>"/>&nbsp;</td>
            <td colspan="2"><input name="imageField" type="image" src="images/button_ok.gif" width="60" height="22" border="0" class="np" /></td>
          </tr>
        
      </table></td>
  </tr>
</table>
</form>
<script language="JavaScript">
(function($){
	function showcode(idName){
		$("#advert").html("").html($("#formtxt>#"+idName).html());
		$("#adstyle").val(idName);
	}
	
	showcode('code');

	$("#changeTab>li").click(function()
	{
		var tabLi = $(this);
		var thistab = tabLi[0].id;
		$(".content").each(function()
		{
			if("t_" + $(this)[0].id == thistab)
			{ 
			    $("#changeTab>li").removeClass("act");
			    $("#t_" + $(this)[0].id).addClass("act");
			    showcode($(this)[0].id);
			}
		})
	})
})(jQuery);
</script>
</body>
</html>